#ifndef FFMPEGUTILS_H
#define FFMPEGUTILS_H

#include <QObject>


extern "C" {

    #include <libswresample/swresample.h>
    #include <libavutil/avutil.h>
}

#define ERRMES(err_num) \
    char err_buf[1024]; \
    av_strerror(err_num,err_buf,sizeof(err_buf));


typedef  struct{

    const char *pcm_file;
    int sample_rate;
    // 声道数 AV_CH_LAYOUT_MONO 或者 AV_CH_LAYOUT_STEREO
    int channel_layout;
    AVSampleFormat sample_format;

}ResampleStruct;


class FFMPEGUtils : public QObject
{
    Q_OBJECT
public:
    explicit FFMPEGUtils(QObject *parent = nullptr);
    void resamplePCM();
    static void resamplePCM(ResampleStruct &in, ResampleStruct &out);
signals:


};

#endif // FFMPEGUTILS_H
